Skip to content

Dereference relative symlinks when staging user themes - #9280

Open
fresh3nough wants to merge 1 commit into
omacom:quattrofrom
fresh3nough:fix/issue-9253-theme-relative-symlink
Open

Dereference relative symlinks when staging user themes#9280
fresh3nough wants to merge 1 commit into
omacom:quattrofrom
fresh3nough:fix/issue-9253-theme-relative-symlink

Conversation

@fresh3nough

Copy link
Copy Markdown

Summary

Fixes #9253.

User-authored themes under ~/.config/omarchy/themes/<name>/ that keep colors.toml as a relative symlink (typical dotfiles layout) were staged with cp -r, which copies the link text verbatim. After the swap into ~/.local/state/omarchy/current/theme/, that relative path resolves from the wrong depth, colors.toml becomes a dangling symlink, and omarchy-theme-set-templates silently generates nothing — no ghostty colors, no bar theme, etc.

Installed (git-cloned) themes keep the existing refuse-symlinks path. Only the non-repo user-theme path changes.

Change

Replace bare cp -r for user themes with stage_user_theme / stage_user_theme_dir, which dereference resolving symlinks (cp -L / cp -rL) and skip dangling ones with a warning.

Test plan

  • Reproduced on GCP VM: relative symlink colors.toml staged as dangling; no ghostty.conf
  • After fix: staged as regular file with target content; ghostty.conf generated
  • test/shell.d/theme-staging-test.sh passes (new case + existing installed-theme symlink refusal)
./test/shell.d/theme-staging-test.sh

User themes that keep colors.toml as a relative symlink into a dotfiles
tree were staged with cp -r, which copies link text verbatim. After the
swap into current/theme the relative path resolves from the wrong depth,
colors.toml goes dangling, and template generation silently produces
nothing. Stage user themes by dereferencing symlink content instead.

Fixes omacom#9253

Signed-off-by: fresh3nough <anonwurcod@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

theme set silently breaks theming when a user theme's colors.toml is a relative symlink

1 participant